local kesheng = fk.CreateSkill {
  name = "lingling__kesheng",
}

Fk:loadTranslationTable{
  ["lingling__kesheng"] = "克胜",
  [":lingling__kesheng"] = "回合结束时，若有本回合你对其使用过牌且手牌数或体力不大于1的角色，你可以摸两张牌。",
}

kesheng:addEffect(fk.TurnEnd, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(kesheng.name) and
      #player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function (e)
        local use = e.data
        return table.find(use.tos, function (p)
          return p.hp <= 1 or p:getHandcardNum() <= 1
        end) ~= nil
      end, Player.HistoryTurn) > 0
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(2, kesheng.name)
  end,
})

return kesheng
